*********************
** Tables 3 and A.4: Covariates of out-group discrimination
*********************

su NumFriendsOutGroup
replace NumFriendsOutGroup = NumFriendsOutGroup - `r(mean)'

local cluster cluster(clustering)
local cluster_label "Class"

local outcome SharingGameDiscrimination
local task ""
local depVar "Out-Group Discrimination"
local label "Composite Index"

* Regressions: Morning Shift
	reg `outcome' PalestinianRoots if !shift, rob `cluster'
	
	eststo full_m: reg `outcome' TimeGoingToThisSchool c.FriendsFromOutGroupAtSchool##c.NumFriendsOutGroup SyrianRelatives PalestinianRoots ParAtt_Tragedy ParAtt_JordanDoneEnough ParAtt_RentalPrice ParAtt_Jobs  if !shift, rob `cluster'
	estadd local controls "No"
	
	eststo full_m_soc: reg `outcome' TimeGoingToThisSchool c.FriendsFromOutGroupAtSchool##c.NumFriendsOutGroup SyrianRelatives PalestinianRoots ParAtt_Tragedy ParAtt_JordanDoneEnough ParAtt_RentalPrice ParAtt_Jobs childMale nChildren parentMale  governorateIncome i.b0.parentEducation parentsHaveSmartphone parentsHaveBooks if !shift, rob `cluster'
	estadd local controls "Yes"

* Regressions: Afternoon Shift
	eststo full_a: reg `outcome' TimeGoingToThisSchool c.FriendsFromOutGroupAtSchool##c.NumFriendsOutGroup JordanianRelatives OriginToAmman TimeInJordan  ParAtt_Tragedy ParAtt_JordanDoneEnough ParAtt_RentalPrice ParAtt_Jobs if shift & !TimeInJordan_long, rob `cluster'
	estadd local controls "No"
	
	eststo full_a_soc: reg `outcome' TimeGoingToThisSchool c.FriendsFromOutGroupAtSchool##c.NumFriendsOutGroup JordanianRelatives OriginToAmman TimeInJordan  ParAtt_Tragedy ParAtt_JordanDoneEnough ParAtt_RentalPrice ParAtt_Jobs childMale nChildren parentMale governorateIncome i.b0.parentEducation parentsHaveSmartphone parentsHaveBooks if shift & !TimeInJordan_long, rob `cluster'
	estadd local controls "Yes"

	* Table 3 with and without SES control variables but omitted 
	esttab full_m full_m_soc full_a full_a_soc using "2_output\Table3.rtf", ///
	star(* .1 ** .05 *** .01) se b(3) stats(controls r2 N, layout(@ @ @) fmt(0 2 0) labels("SES Controls" "R^2" "Observations^a")) ///
	label compress noeqlines nonumber replace depvars nonotes nogaps modelwidth(12 12) varwidth(24) interaction(" x ") refcat(1.parentEducation "Parental education", nolabel) ///
	mtitles("[1] Jordanian Children, Morning Shift" "[2] Jordanian Children, Morning Shift (w./ SES)^#" "[3] Syrian Children, Afternoon Shift" "[4] Syrian Children, Afternoon Shift (w./ SES)^#") ///
	mgroups("Dependent variable: `depVar' - `label'", span pattern(1 0)) ///
	order(TimeGoingToThisSchool FriendsFromOutGroupAtSchool NumFriendsOutGroup c.FriendsFromOutGroupAtSchool#c.NumFriendsOutGroup SyrianRelatives PalestinianRoots JordanianRelatives OriginToAmman TimeInJordan ParAtt_Tragedy ParAtt_JordanDoneEnough ParAtt_RentalPrice ParAtt_Jobs) ///
	keep(TimeGoingToThisSchool FriendsFromOutGroupAtSchool NumFriendsOutGroup c.FriendsFromOutGroupAtSchool#c.NumFriendsOutGroup SyrianRelatives PalestinianRoots JordanianRelatives OriginToAmman TimeInJordan ParAtt_Tragedy ParAtt_JordanDoneEnough ParAtt_RentalPrice ParAtt_Jobs)  ///
	addnote("Cluster-robust standard errors (clustered at the class level) in parentheses. 'Number of out-group friends' is mean centralized. See Appendix for full regression results." "^a: Nine parents did not indicate either whether they had Syrian relatives or Palestinian roots. For some parents of children in the afternoon shift, we do not have information on their origin in Syria and whether they have relatives in Jordan. Moreover, we have excluded nine observations from the afternoon shift that reported an arrival time in Jordan before outbreak of the war. This explains the lower number of observations in the regressions compared to Table 1." "See Table A.4 in the Online Append for the full model that also shows the estimates for the SES-control variables that are listed in Table A.3." "* p < .1, ** p < .05, *** p < .01")
	
	* Table A.4 with all control variables for appendix
	esttab full_m_soc full_a_soc using "2_output\TableA4.rtf", ///
	star(* .1 ** .05 *** .01) se b(3) stats(r2 N, layout(@ @) fmt(2 0) labels("R^2" "Observations^a")) ///
	label compress noeqlines nonumber replace depvars nonotes wide modelwidth(12 12) varwidth(24) interaction(" x ") refcat(1.parentEducation "Parental education", nolabel) drop(0.parentEducation) ///
	mtitles("[1] Jordanian Children, Morning Shift" "[2] Syrian Children, Afternoon Shift") ///
	mgroups("Dependent variable: `depVar' - `label'", span pattern(1 0)) ///
	order(TimeGoingToThisSchool FriendsFromOutGroupAtSchool NumFriendsOutGroup c.FriendsFromOutGroupAtSchool#c.NumFriendsOutGroup SyrianRelatives PalestinianRoots JordanianRelatives OriginToAmman TimeInJordan ParAtt_Tragedy ParAtt_JordanDoneEnough ParAtt_RentalPrice ParAtt_Jobs childMale nChildren parentMale governorateIncome 0.parentEducation 1.parentEducation 2.parentEducation 4.parentEducation parentsHaveSmartphone parentsHaveBooks) ///
	addnote("Cluster-robust standard errors (clustered at the class level) in parentheses; reference category for education is 'Literate but incomplete high school' and 'Number of out-group friends' is mean centralized." "^a: Nine parents did not indicate either whether they had Syrian relatives or Palestinian roots. For some parents of children in the afternoon shift, we do not have information on their origin in Syria and whether they have relatives in Jordan. Moreover, we have excluded 9 observations from the afternoon shift that reported an arrival time in Jordan before outbreak of the war. Therefore, the number of observations in these regressions differ compared to those reported in Columns 1 or 2 of Tables 3 and 4, but is identical to those reported in Column 3 of said tables." "* p < .1, ** p < .05, *** p < .01")	

* Have a nice day!
